<?php

namespace apiend\controllers;

use Yii;
use apiend\components\Controller;

/**
 * 应用站点相关接口
 * 
 * @author emhome <emhome@163.com>
 * @since 1.0
 */
class SiteController extends Controller {

    /**
     * Declares the allowed HTTP verbs.
     * Please refer to [[VerbFilter::actions]] on how to declare the allowed verbs.
     * @return array the allowed HTTP verbs.
     */
    protected function verbs() {
        return [
            '*' => ['GET'],
        ];
    }

    /**
     * @inheritdoc
     */
    protected function rules() {
        return [
            [
                'allow' => true,
                'roles' => ['?'],
            ],
        ];
    }

    /**
     * 全局默认接口
     * @return mixed
     */
    public function actionIndex() {
        return [
            'app' => Yii::$app->id,
            'name' => Yii::$app->name,
        ];
    }

}
